import Vue from 'vue';

import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import AdminLayout from '../layout/AdminLayout.vue'
import LoginLayout from '../layout/LoginLayout.vue'
import Login from '../views/Login.vue'

// 在Vue中安装VueRouter
Vue.use(VueRouter)


const router = new VueRouter({
    routes: [{
            path: '/',
            redirect: '/index'
        },
        {
            path: '/index',
            component: AdminLayout,
            children: [{
                path: '',
                component: Index
            }]
        },
        {
            path: '/login',
            component: LoginLayout,
            children: [{
                path: '',
                component: Login
            }]
        }
    ]
})
export default router;